package com.taoym.voucher.xcx.message;

import lombok.AllArgsConstructor;
import lombok.Data;
import org.springframework.util.ObjectUtils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Map;

/**
 * @coder taoym
 * @datetime 2021/6/4 15:35
 * @desc 小程序消息推送消息模板
 */
public class MessageDataMap {

    private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

    /**
     * @coder taoym
     * @datetime 2021/6/20 23:14
     * @desc 获取
     */
    public static Map<String, Object> getDataMap(String amount, String status, String remark) {
        Map<String, Object> dataMap = new HashMap<>();
        dataMap.put("amount1", new Value(amount));
        dataMap.put("phrase2", new Value("佣金提现"));
        dataMap.put("date3", new Value(FORMATTER.format(LocalDateTime.now())));
        dataMap.put("phrase4", new Value(status));
        dataMap.put("thing5", new Value(ObjectUtils.isEmpty(remark) ? "佣金提现提醒" : remark));

        return dataMap;
    }
    /**
     * @coder taoym
     * @datetime 2021/6/20 23:13
     * @desc 获取审核结果数据集合
     */
    public static Map<String,Object> getVerifyResultMap(String result,String remark){
        Map<String,Object> dataMap = new HashMap<>();
        dataMap.put("thing1",new Value("团长申请"));
        dataMap.put("phrase2",new Value(result));
        dataMap.put("time3",new Value(FORMATTER.format(LocalDateTime.now())));
        dataMap.put("thing4",new Value(remark));

        return dataMap;
    }

    @Data
    @AllArgsConstructor
    public static class Value {
        private String value;
    }
}
